home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / comm / gs32.zip / BUILD.001 < prev    next >
Text File  |  1996-08-23  |  5KB  |  191 lines

  1. <SCRIPT LANGUAGE="JavaScript">
  2. <!--
  3. var timerID = null;
  4. var timerRunning = false;
  5. var id,pause=0,position=0;
  6. var loveIt = 0;
  7. var likeIt = 0;
  8. var noComment = 0;
  9. var itIsCool = 0;
  10. var itIsHot = 0;
  11. var itIsJazzy = 0;
  12. var itIsNormal = 0;
  13. var IWantIt = 0;
  14. var secondTimeEmail = 0;
  15. var secondTimeName = 0;
  16.  
  17. function ticker()
  18. {
  19.   var i,k,msg="Thank you for visiting my page.        Please record your visit by signing my guest book!                                                              ";
  20.   k=(95/msg.length)+2;
  21.   for(i=0;i<=k;i++) msg+="                                 "+msg;
  22.         document.ScrollingMsg.ticker.value=msg.substring(position,position+95);
  23.     position+=2;
  24.     if(position>=155) position=0;
  25.       id=setTimeout("ticker()",2000/10);
  26. }
  27.  
  28. // For edit input boxes only. The Ctrl.fcus is not applicable to radio buttons and gives an error
  29. function validatePrompt (Ctrl, PromptStr)
  30. {
  31.     alert (PromptStr)
  32.         Ctrl.focus();
  33.         return;
  34. }
  35.  
  36. function Acknowledge (Ctrl, PromptStr)
  37. {
  38.     alert (PromptStr)
  39.     return;
  40. }
  41.  
  42. function ShowMsgILoveIt(form)
  43. {
  44.     Ctrl = form.Liking;
  45.    if (!loveIt)
  46.    {
  47.         Acknowledge (Ctrl, "Thank you very kindly. I am glad that you visited my page.\n You are a valued vistor. Please do visit me again and do remember to sign my guest book!!");
  48.         noComment = 0;
  49.       likeIt = 0;
  50.       loveIt = 1;
  51.     }
  52.    else loveIt = 0;
  53. }
  54.  
  55. function ShowMsgILikeIt(form)
  56. {
  57.     Ctrl = form.Liking;
  58.    if (!likeIt)
  59.    {
  60.         Acknowledge (Ctrl, "Thank you! May I have your suggestions to further improve my page so that one will say 'I LOVE IT' !!");
  61.         noComment = 0;
  62.       likeIt = 1;
  63.       loveIt = 0;
  64.     }
  65.    else likeIt = 0;
  66. }
  67.  
  68.  
  69. function ShowMsgNoComment(form)
  70. {
  71.     Ctrl = form.Liking;
  72.     if (!noComment)
  73.    {
  74.         Acknowledge (Ctrl, "Thank you for your time in advance. Would you kindly spare a moment to tell me which aspect of my page(s) needs improvement?");
  75.         noComment = 1;
  76.       likeIt = 0;
  77.       loveIt = 0;
  78.     }
  79.    else noComment = 0;
  80. }
  81.  
  82. function ShowMsgItIsCool(form)
  83. {
  84.     Ctrl = form.User_description_a;
  85.     if (!itIsCool)
  86.    {
  87.         Acknowledge (Ctrl, "Thank you very very much. I am flattered!.\n Please do sign the guestbook and please visit my page again.");
  88.       itIsCool = 1;
  89.     }
  90.    else itIsCool = 0;
  91. }
  92.  
  93. function ShowMsgItIsHot(form)
  94. {
  95.     Ctrl = form.User_description_b;
  96.     if (!itIsHot)
  97.    {
  98.         Acknowledge (Ctrl, "Thank you very much. I am glad that you liked my page. Please visit again.");
  99.       itIsHot = 1;
  100.     }
  101.    else itIsHot = 0;
  102. }
  103.  
  104. function ShowMsgItIsJazzy(form)
  105. {
  106.     Ctrl = form.User_description_c;
  107.     if (!itIsJazzy)
  108.    {
  109.         Acknowledge (Ctrl, "Thank you, kindly. I will try to make it jazzier on your next visit. Please sign the book.");
  110.       itIsJazzy = 1;
  111.     }
  112.    else itIsJazzy = 0;
  113. }
  114.  
  115. function ShowMsgItIsNormal(form)
  116. {
  117.     Ctrl = form.User_description_d;
  118.     if (!itIsNormal)
  119.    {
  120.         Acknowledge (Ctrl, "Thank you. Please visit my page again.");
  121.       itIsNormal = 1;
  122.     }
  123.    else itIsNormal = 0;
  124. }
  125.  
  126. function ShowMsgIWantIt(form)
  127. {
  128.     Ctrl = form.User_said;
  129.     if (!IWantIt)
  130.    {
  131.         Acknowledge (Ctrl, "Certainly. You can save this page into a HTML file and edit it to suit you.\n Alternatively, you can download Guest*Star, the program that writes guestbook and its CGI, from http://www.webgenie.com/software/guestar.html.");
  132.       IWantIt = 1;
  133.     }
  134.    else IWantIt = 0;
  135. }
  136.  
  137. function TestEmailBox(form) {
  138.  
  139.     // Check the User name
  140.       Ctrl = form.Visitor_name;
  141.     if (Ctrl.value == "")
  142.    {
  143.         if (!secondTimeName)
  144.       {
  145.             validatePrompt (Ctrl, "You haven't specified your name.\nPlease type it in, or if you prefer not to enter it, press the submit button again to record your visit.")
  146.           secondTimeName = 1;
  147.           return false;
  148.       }
  149.     }
  150.     // Check the E_mail address
  151.     Ctrl = form.Visitor_email;
  152.     if (Ctrl.value == "" || Ctrl.value.indexOf ('@', 0) == -1  || Ctrl.value.indexOf ('.', 0) == -1)
  153.    {
  154.         if (!secondTimeEmail)
  155.       {
  156.             validatePrompt (Ctrl, "You haven't specified your E_mail address.\nPlease type it in, or if you prefer not to enter it, press the submit button again to record your visit.")
  157.           secondTimeEmail = 1;
  158.           return false;
  159.       }
  160.     }
  161.     return true;
  162. }
  163.  
  164. function runSubmit (form, button)
  165. {
  166.     if (TestEmailBox(form))
  167.    {
  168.         Ctrl = form.Submit;
  169.         // What does the user say?
  170.         if (loveIt || likeIt || itIsCool || itIsJazzy)
  171.        {
  172.             Acknowledge (Ctrl, "Thank you for signing my guest book and special thanks for your good comments.\n Please view my guest book to see your entry.")
  173.        }
  174.         else
  175.       {
  176.           Acknowledge (Ctrl, "Thank you for signing my guest book.\n Please view my guest book to see your entry.")
  177.         }
  178.         document.guestbook.submit();
  179.     }
  180.     return;
  181. }
  182. //-->
  183.  
  184. </SCRIPT>
  185.  
  186. </HEAD>
  187.  
  188. <BODY onLoad="ticker()" BACKGROUND="pink_fab.GIF" link="#EB961E" vlink=a0a0ff alink=a0a0ff>
  189. <center>
  190.  
  191.